home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{4E36AC7F-0302-11D3-AFE0-B4CDD86B7B11}#1.0#0"; "AePopup6D.OCX"
- Begin VB.Form frmEntryBox
- ClientHeight = 4200
- ClientLeft = 60
- ClientTop = 60
- ClientWidth = 7620
- ControlBox = 0 'False
- LinkTopic = "Form1"
- LockControls = -1 'True
- MDIChild = -1 'True
- ScaleHeight = 4200
- ScaleWidth = 7620
- WindowState = 2 'Maximized
- Begin VB.PictureBox picFrame
- Appearance = 0 'Flat
- ClipControls = 0 'False
- ForeColor = &H80000008&
- Height = 3495
- Left = 120
- ScaleHeight = 231
- ScaleMode = 3 'Pixel
- ScaleWidth = 475
- TabIndex = 1
- TabStop = 0 'False
- Top = 240
- Width = 7155
- Begin AePopup6D.AeCommandBox acbClearEvents
- Height = 210
- Left = 1950
- TabIndex = 20
- TabStop = 0 'False
- ToolTipText = "Clear events"
- Top = 1395
- Width = 555
- _ExtentX = 979
- _ExtentY = 370
- BackColor = -2147483632
- ForeColor = -2147483628
- Picture = "EntryBox.frx":0000
- Appearance = 2
- ShowFocus = 0 'False
- End
- Begin VB.Timer tmrStopwatch
- Enabled = 0 'False
- Interval = 1000
- Left = 240
- Top = 720
- End
- Begin VB.TextBox txtEvents
- Appearance = 0 'Flat
- BackColor = &H8000000F&
- BorderStyle = 0 'None
- Height = 1695
- Left = 90
- Locked = -1 'True
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 17
- TabStop = 0 'False
- Text = "EntryBox.frx":00BE
- Top = 1620
- Width = 2415
- End
- Begin VB.Frame frmProperties
- Caption = "Properties"
- Height = 3250
- Left = 2640
- TabIndex = 2
- Top = 60
- Width = 4400
- Begin AePopup6D.AeEntryBox aebMinValue
- Height = 315
- Left = 1440
- TabIndex = 8
- Top = 1140
- Width = 1275
- _ExtentX = 2249
- _ExtentY = 556
- End
- Begin AePopup6D.AeEntryBox aebMaxValue
- Height = 315
- Left = 2940
- TabIndex = 9
- Top = 1140
- Width = 1275
- _ExtentX = 2249
- _ExtentY = 556
- End
- Begin VB.Frame frmPopupForm
- Caption = "Popup Form"
- Height = 1215
- HelpContextID = 4
- Index = 1
- Left = 2520
- TabIndex = 14
- Top = 1800
- Width = 1695
- Begin VB.CheckBox chkRightAlign
- Caption = "&RightAlign"
- Height = 255
- HelpContextID = 811
- Left = 120
- TabIndex = 15
- Top = 360
- Width = 1215
- End
- Begin VB.CheckBox chkMoveWithParent
- Caption = "&MoveWithParent"
- Height = 255
- HelpContextID = 814
- Left = 120
- TabIndex = 16
- Top = 720
- Width = 1515
- End
- End
- Begin VB.CheckBox chkPicture
- Caption = "&Picture"
- Height = 255
- Left = 240
- TabIndex = 13
- Top = 2820
- Width = 915
- End
- Begin VB.CheckBox chkCustomised
- Caption = "C&ustomised"
- Height = 255
- Left = 240
- TabIndex = 12
- Top = 2460
- Width = 1455
- End
- Begin VB.ComboBox cboDataType
- Height = 315
- HelpContextID = 109
- ItemData = "EntryBox.frx":00C7
- Left = 1740
- List = "EntryBox.frx":00F5
- Style = 2 'Dropdown List
- TabIndex = 4
- Top = 300
- Width = 2475
- End
- Begin VB.CheckBox chkAutoComplete
- Caption = "Auto &Complete"
- Height = 255
- HelpContextID = 114
- Left = 240
- TabIndex = 11
- Top = 2100
- Width = 1635
- End
- Begin VB.ComboBox cboFormatString
- Height = 315
- HelpContextID = 110
- ItemData = "EntryBox.frx":016F
- Left = 1740
- List = "EntryBox.frx":0171
- TabIndex = 6
- Top = 720
- Width = 2475
- End
- Begin VB.CheckBox chkUpperCase
- Caption = "Force &Upper Case"
- Height = 255
- HelpContextID = 111
- Left = 240
- TabIndex = 10
- Top = 1740
- Width = 1635
- End
- Begin VB.Label lblProperties
- AutoSize = -1 'True
- Caption = "Min/Max&Value:"
- Height = 195
- Index = 1
- Left = 240
- TabIndex = 7
- Top = 1200
- Width = 1080
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "/"
- Height = 195
- Left = 2760
- TabIndex = 19
- Top = 1200
- Width = 75
- End
- Begin VB.Label lblProperties
- AutoSize = -1 'True
- Caption = "&Data Type:"
- Height = 195
- Index = 0
- Left = 240
- TabIndex = 3
- Top = 360
- Width = 795
- End
- Begin VB.Label lblProperties
- AutoSize = -1 'True
- Caption = "&Format String:"
- Height = 195
- Index = 6
- Left = 240
- TabIndex = 5
- Top = 780
- Width = 975
- End
- Begin VB.Image imgClosedFolder
- Height = 195
- Left = 1260
- Picture = "EntryBox.frx":0173
- Top = 2820
- Visible = 0 'False
- Width = 240
- End
- Begin VB.Image imgOpenFolder
- Height = 195
- Left = 1620
- Picture = "EntryBox.frx":025D
- Top = 2820
- Visible = 0 'False
- Width = 240
- End
- End
- Begin AePopup6D.AeEntryBox aebMain
- Height = 315
- HelpContextID = 101
- Left = 240
- TabIndex = 0
- Top = 300
- Width = 2295
- _ExtentX = 4048
- _ExtentY = 556
- MousePointer = 0
- Style = 4
- DataType = 7
- FormatString = "Short Date"
- End
- Begin VB.Label lblEvents
- BackColor = &H80000010&
- Caption = "Events:"
- ForeColor = &H80000014&
- Height = 210
- Left = 90
- TabIndex = 18
- Top = 1400
- Width = 2415
- End
- End
- Attribute VB_Name = "frmEntryBox"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Private WithEvents m_PopupForm As AePopupForm
- Attribute m_PopupForm.VB_VarHelpID = -1
- Private Const M_S_EntryBoxWidth = 0
- Private Const M_S_PropsLeft = 1
- Private Const M_S_PropsHeight = 2
- Private Const M_S_EventsHeight = 3
- Private Const M_S_EventsWidth = 4
- Private Const M_S_ClearEventsLeft = 5
- Private m_Offsets(M_S_EntryBoxWidth To M_S_ClearEventsLeft) As Integer
- Public Property Let Style(ByVal New_Style As AeEntryBoxStyles)
- tmrStopwatch.Enabled = False
-
- aebMain.List.Clear
- If New_Style = aeComboBox Then
- With aebMain.List
- .Add "Apples"
- .Add "Bananas"
- .Add "Oranges"
- .Add "Lemons"
- .Add "Plums"
- .Add "Cherries"
- End With
- aebMain.Text = "Apples"
- ElseIf New_Style = aeSpinBox Then
- aebMain.Text = 0
- End If
-
- 'set up the custom box
- If New_Style = aeCustomBox Then
- aebMain.Style = aeTimeBox
- aebMain.FormatString = "hh:nn:ss"
- Dim oButton As AeButton
- 'menu button
- Set oButton = aebMain.Buttons.Add()
- aebMain.Buttons.Actions(2) = aePopupMenu
- aebMain.Buttons.Symbols(2) = aeComboSymbol
- aebMain.Menu.Add "5 seconds"
- aebMain.Menu.Add "10 seconds"
- aebMain.Menu.Add "30 seconds"
- aebMain.Menu.Add "1 minute"
- aebMain.Menu.Add "5 minutes"
- 'play button
- Set oButton = aebMain.Buttons.Add()
- oButton.Style = aeGroupButton
- oButton.ToolTipText = "Start"
- aebMain.Buttons.Symbols(3) = aePlaySymbol
- 'stop button
- Set oButton = aebMain.Buttons.Add()
- oButton.Style = aeGroupButton
- oButton.ToolTipText = "Stop"
- aebMain.Buttons.Symbols(4) = aeStopSymbol
- 'pause button
- Set oButton = aebMain.Buttons.Add()
- oButton.Style = aeToggleButton
- oButton.ToolTipText = "Pause"
- aebMain.Buttons.Symbols(5) = aePauseSymbol
-
- aebMain.Buttons(4).Value = aeToggled
- Else
- aebMain.Menu.Clear
- aebMain.Style = New_Style
- End If
-
- 'some properties are reset with the style
- Dim n As Integer
- Dim iType As Integer
- iType = aebMain.DataType
- For n = 0 To cboDataType.ListCount - 1
- If cboDataType.ItemData(n) = iType Then Exit For
- Next n
- If n < cboDataType.ListCount Then cboDataType.ListIndex = n
- cboFormatString.Text = aebMain.FormatString
- End Property
- Private Sub acbClearEvents_Click()
- txtEvents.Text = "(none)"
- End Sub
- Private Sub aebMain_ActionSet(ByVal ActionCode As AePopup6D.AeEntryBoxActions, Cancel As Boolean)
- Dim s As String
- Select Case ActionCode
- Case aeDecreaseValue: s = "aeDecreaseValue"
- Case aeIncreaseValue: s = "aeIncreaseValue"
- Case aePopupCalendar: s = "aePopupCalendar"
- Case aePopupClock: s = "aePopupClock"
- Case aePopupCustom: s = "aePopupCustom"
- Case aePopupList: s = "aePopupList"
- Case aePopupMenu: s = "aePopupMenu"
- Case aeSetFalse: s = "aeSetFalse"
- Case aeSetTrue: s = "aeSetTrue"
- End Select
- p_AddEvent "ActionSet" & vbTab & s
-
- End Sub
- Private Sub aebMain_ButtonClick(Button As AePopup6D.AeButton)
- p_AddEvent "ButtonClick" & vbTab & CStr(Button.Index)
- 'stopwatch functions for aeCustomBox
- If aebMain.Style = aeCustomBox Then
- Select Case Button.Index
- Case 3 'play
- tmrStopwatch.Enabled = True
- Case 4 'stop
- tmrStopwatch.Enabled = False
- aebMain.Text = ""
- aebMain.Buttons(5).Value = aeUp 'un-pause
- Case 5 'pause
- tmrStopwatch.Enabled = (Button.Value = aeUp)
- End Select
- End If
- End Sub
- Private Sub aebMain_Change()
- p_AddEvent "Change"
- End Sub
- Private Sub aebMain_Click()
- p_AddEvent "Click"
- End Sub
- Private Sub aebMain_MenuClick(MenuItem As AePopup6D.AeMenuItem)
- p_AddEvent "MenuClick" & vbTab & CStr(MenuItem.Index)
- Select Case MenuItem.Index
- Case 1: aebMain.Value = TimeSerial(0, 0, 5)
- Case 2: aebMain.Value = TimeSerial(0, 0, 10)
- Case 3: aebMain.Value = TimeSerial(0, 0, 30)
- Case 4: aebMain.Value = TimeSerial(0, 1, 0)
- Case 5: aebMain.Value = TimeSerial(0, 5, 0)
- End Select
- End Sub
- Private Sub aebMain_MenuHighlight(MenuItem As AePopup6D.AeMenuItem)
- p_AddEvent "MenuHighlight" & vbTab & CStr(MenuItem.Index)
- End Sub
- Private Sub aebMain_MenuPopup(Menu As AePopup6D.AeMenu)
- p_AddEvent "MenuPopup"
- End Sub
- Private Sub aebMaxValue_Change()
- aebMain.MaxValue = aebMaxValue.Value
- End Sub
- Private Sub aebMinValue_Change()
- aebMain.MinValue = aebMinValue.Value
- End Sub
- Private Sub cboDataType_Click()
- Dim bEnabled As Boolean
- aebMain.DataType = cboDataType.ItemData(cboDataType.ListIndex)
- cboFormatString.Clear
- bEnabled = True
- Select Case aebMain.DataType
- Case aeBoolean
- cboFormatString.AddItem "True/False"
- cboFormatString.AddItem "Yes/No"
- bEnabled = False
- Case aeDate
- cboFormatString.AddItem "General Date"
- cboFormatString.AddItem "Short Date"
- cboFormatString.AddItem "dd, mmmm yyyy"
- cboFormatString.AddItem "dd-mmm-yyyy"
- cboFormatString.AddItem "mmm yyyy"
- aebMinValue.Style = aeDateBox
- aebMaxValue.Style = aeDateBox
- Case aeTime
- cboFormatString.AddItem "Long Time"
- cboFormatString.AddItem "Short Time"
- cboFormatString.AddItem "hh:nn am/pm"
- aebMinValue.Style = aeTimeBox
- aebMaxValue.Style = aeTimeBox
- Case aeCurrency
- aebMinValue.Style = aeSpinBox
- aebMaxValue.Style = aeSpinBox
- aebMinValue.DataType = aebMain.DataType
- aebMaxValue.DataType = aebMain.DataType
- cboFormatString.AddItem "Currency"
- Case aeLong, aeInteger, aeSingle, aeDouble, aeDecimal
- aebMinValue.Style = aeSpinBox
- aebMaxValue.Style = aeSpinBox
- aebMinValue.DataType = aebMain.DataType
- aebMaxValue.DataType = aebMain.DataType
- Case aeVariant
- aebMinValue.Style = aeTextBox
- aebMaxValue.Style = aeTextBox
- aebMinValue.DataType = aeString
- aebMaxValue.DataType = aeString
- Case Else
- aebMinValue.Style = aeTextBox
- aebMaxValue.Style = aeTextBox
- aebMinValue.DataType = aeString
- aebMaxValue.DataType = aeString
- aebMinValue.Value = Empty
- aebMaxValue.Value = Empty
- bEnabled = False
- End Select
- aebMinValue.Enabled = bEnabled
- aebMaxValue.Enabled = bEnabled
- If bEnabled Then
-
- Else
- End If
- End Sub
- Private Sub cboFormatString_Change()
- On Error Resume Next 'incase invalid format string
- aebMain.FormatString = cboFormatString.Text
- End Sub
- Private Sub cboFormatString_Click()
- aebMain.FormatString = cboFormatString.Text
- End Sub
- Private Sub chkAutoComplete_Click()
- aebMain.AutoComplete = (chkAutoComplete = vbChecked)
- End Sub
- Private Sub chkCustomised_Click()
- If chkCustomised.Value = vbChecked Then
- aebMain.BackColor = RGB(255, 255, 200)
- aebMain.ForeColor = vbBlue
- Dim oFont As New StdFont
- oFont.Name = "MS Serif"
- oFont.Size = 10
- Set aebMain.Font = oFont
- aebMain.Height = 24
- Else 'defaults
- aebMain.BackColor = vbWindowBackground
- aebMain.ForeColor = vbWindowText
- Set aebMain.Font = picFrame.Font
- aebMain.Height = 21
- End If
- End Sub
- Private Sub chkMoveWithParent_Click()
- aebMain.PopupForm.MoveWithParent = (chkMoveWithParent.Value = vbChecked)
- End Sub
- Private Sub chkPicture_Click()
- If chkPicture.Value = vbChecked Then
- Set aebMain.Picture = imgClosedFolder.Picture
- aebMain.PictureWidth = 20
- Else 'defaults
- aebMain.PictureWidth = 0
- Set aebMain.Picture = Nothing
- End If
- End Sub
- Private Sub chkRightAlign_Click()
- aebMain.PopupForm.RightAlign = (chkRightAlign.Value = vbChecked)
- End Sub
- Private Sub chkUpperCase_Click()
- aebMain.UpperCase = (chkUpperCase.Value = vbChecked)
- End Sub
- Private Sub Form_Load()
- 'initialise property controls
- cboDataType.ListIndex = 3 'aeDate
- cboFormatString.Text = aebMain.FormatString
- chkAutoComplete.Value = Abs(aebMain.AutoComplete)
- chkUpperCase.Value = Abs(aebMain.UpperCase)
- chkRightAlign.Value = Abs(aebMain.PopupForm.RightAlign)
- chkMoveWithParent.Value = Abs(aebMain.PopupForm.MoveWithParent)
- 'hook in to popup form events
- Set m_PopupForm = aebMain.PopupForm
- 'set up resizing frame
- With picFrame
- m_Offsets(M_S_EntryBoxWidth) = .ScaleWidth - aebMain.Width
- m_Offsets(M_S_PropsLeft) = .ScaleWidth - frmProperties.Left
- m_Offsets(M_S_PropsHeight) = .ScaleHeight - frmProperties.Height
- m_Offsets(M_S_EventsHeight) = .ScaleHeight - txtEvents.Height
- m_Offsets(M_S_EventsWidth) = .ScaleWidth - txtEvents.Width
- m_Offsets(M_S_ClearEventsLeft) = .ScaleWidth - acbClearEvents.Left
- .BorderStyle = 0
- End With
- End Sub
- Private Sub Form_Resize()
- picFrame.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- 'clean up references
- Set m_PopupForm = Nothing
- End Sub
- Private Sub m_PopupForm_Load(ByVal Modal As Boolean)
- 'change the picture whenever a popup form is shown
- If chkPicture.Value = vbChecked Then
- Set aebMain.Picture = imgOpenFolder.Picture
- End If
- End Sub
- Private Sub m_PopupForm_Unload(Cancel As Boolean, ByVal UnloadMode As Integer)
- 'change the picture whenever the popup form is hidden
- If chkPicture.Value = vbChecked Then
- Set aebMain.Picture = imgClosedFolder.Picture
- End If
- End Sub
- Private Sub picFrame_Resize()
- 'reposition controls
- aebMain.Width = Abs(picFrame.ScaleWidth - m_Offsets(M_S_EntryBoxWidth))
- frmProperties.Left = Abs(picFrame.ScaleWidth - m_Offsets(M_S_PropsLeft))
- frmProperties.Height = Abs(picFrame.ScaleHeight - m_Offsets(M_S_PropsHeight))
- txtEvents.Height = Abs(picFrame.ScaleHeight - m_Offsets(M_S_EventsHeight))
- txtEvents.Width = Abs(picFrame.ScaleWidth - m_Offsets(M_S_EventsWidth))
- lblEvents.Width = Abs(picFrame.ScaleWidth - m_Offsets(M_S_EventsWidth))
- acbClearEvents.Left = Abs(picFrame.ScaleWidth - m_Offsets(M_S_ClearEventsLeft))
- End Sub
- Private Sub tmrStopwatch_Timer()
- Dim d As Date
- d = aebMain.Value - TimeSerial(0, 0, 1)
- If d <= 0 Then
- aebMain.Value = 0
- aebMain.Buttons(4).Value = aeToggled
- Else
- aebMain.Value = d
- End If
- End Sub
- 'Private Methods
- '==============
- Private Sub p_AddEvent(Caption As String)
- Dim sText As String
- sText = txtEvents.Text
- If Left$(sText, 6) = "(none)" Then
- sText = Caption
- Else
- sText = sText & vbCrLf & Caption
- End If
- txtEvents.Text = sText
- txtEvents.SelStart = Len(sText)
- End Sub
-